package com.vivek.guess.what.calculator;

import java.util.List;

import com.vivz.guess.what.type.Position;
import com.vivz.guess.what.vo.Clue;
import com.vivz.guess.what.vo.Guess;
import com.vivz.guess.what.vo.ProbabilityMatrix;

public class All0Calculator extends AbstractCalculator {

	@Override
	public void calculate(final List<Guess> guesses, final ProbabilityMatrix pMatrix) {

		for (final Guess guess0 : guesses) {
			final Clue clue0 = guess0.getClue();
			if (!clue0.hasCrosses() && clue0.hasDots()) {
				final String word = guess0.getWord();
				for (final Character ch : word.toCharArray()) {
					final Position p = Position.getInstance(1 + word.indexOf(ch));
					pMatrix.markOnlyImpossiblePosition(ch, p, false);
				}
			}
		}
	}

}
